ExifFormat::exif_read_app(ExifApp* app)
{
gbsize_t offs;
- uint32_t exif_ifd_ofs, gps_ifd_ofs, inter_ifd_ofs;
+ uint32_t exif_ifd_ofs;
+ uint32_t gps_ifd_ofs;
+ uint32_t inter_ifd_ofs;
ExifIfd* ifd;
gbfile* fin = app->fexif;
// Recalculate odometer_distance for the whole track unless already
// (properly, i.e. monotonically increasing) set
double dist_sum = 0;
- double prev_lat = 999, prev_lon = 999;
+ double prev_lat = 999;
+ double prev_lon = 999;
double max_speed = 0;
gpsbabel::DateTime prev_time;
for (auto& crpt: course) {
}
// Use current time as creation time if we have nothing better
- gpsbabel::DateTime track_date_time, track_end_date_time, creation_time;
- double first_lat = 999, first_lon = 999, last_lat = 999, last_lon = 999;
+ gpsbabel::DateTime track_date_time;
+ gpsbabel::DateTime track_end_date_time;
+ gpsbabel::DateTime creation_time;
+ double first_lat = 999;
+ double first_lon = 999;
+ double last_lat = 999;
+ double last_lon = 999;
if (!course.empty()) {
track_date_time = creation_time = course.front().creation_time;
track_end_date_time = course.back().creation_time;
void
GarminGPIFormat::read_header()
{
- int len, i;
+ int len;
+ int i;
i = gbfgetint32(fin);
if (i != 0) {
void
GarminGPIFormat::load_bitmap_from_file(const char* fname, const unsigned char** data, int* data_sz)
{
- int i, sz;
+ int i;
+ int sz;
int dest_bpp;
- int src_line_sz, dest_line_sz;
+ int src_line_sz;
+ int dest_line_sz;
bmp_header_t src_h;
gpi_bitmap_header_t* dest_h;
unsigned char* ptr;
GarminTxtFormat::print_position(const Waypoint* wpt)
{
int valid = 1;
- double lat, lon, north, east;
+ double lat;
+ double lon;
+ double north;
+ double east;
int zone;
- char map[3], zonec;
+ char map[3];
+ char zonec;
convert_datum(wpt, &lat, &lon);
{
int method = 0;
uint8_t spam = 0;
- int32_t TrackMaxLat = 0, TrackMaxLon = 0, TrackMinLat = 0, TrackMinLon = 0;
+ int32_t TrackMaxLat = 0;
+ int32_t TrackMaxLon = 0;
+ int32_t TrackMinLat = 0;
+ int32_t TrackMinLon = 0;
char trk_name[30]="";
// TODO: SHIFT - can't test behaviour, do not have appropriate files
//int ii;
int Count = 0; // Used to obtain number of read bytes
int TracksCompleted = 0; // Number of processed tracks
uint8_t TrackBlock[STRK_BLOCK_SIZE]; // File Block
- double Lat = 0, Lon = 0; // wpt data
- double PrevLat = 0, PrevLon = 0, PrevEle = 0; // wpt data
- uint32_t Time = 0, PrevTime = 0; // wpt data
+ double Lat = 0;
+ double Lon = 0; // wpt data
+ double PrevLat = 0;
+ double PrevLon = 0;
+ double PrevEle = 0; // wpt data
+ uint32_t Time = 0;
+ uint32_t PrevTime = 0; // wpt data
uint8_t trk_color = 0xff;
// Skip 12 bytes from the BOF
char typ;
gt_waypt_classes_e wpt_class;
Waypoint* wpt;
- route_head* trk, *rte;
+ route_head* trk;
+ route_head* rte;
int len = FREAD_i32;
if (FREAD(&typ, 1) < 1) {
const Waypoint* wpt, const QString& shortname, const garmin_fs_t* gmsd,
const int icon, const int display)
{
- char zbuf[32], ffbuf[32];
+ char zbuf[32];
+ char ffbuf[32];
waypt_ct++; /* increase informational number of written waypoints */
GdbFormat::write_route(const route_head* rte, const QString& rte_name)
{
bounds bounds;
- char zbuf[32], ffbuf[32];
+ char zbuf[32];
+ char ffbuf[32];
memset(zbuf, 0, sizeof(zbuf));
memset(ffbuf, 0xFF, sizeof(ffbuf));
*pointstr = '\0';
}
- int year = 0, mon = 1, mday = 1, hour = 0, min = 0, sec = 0;
+ int year = 0;
+ int mon = 1;
+ int mday = 1;
+ int hour = 0;
+ int min = 0;
+ int sec = 0;
gpsbabel::DateTime dt;
int res = sscanf(timestr, "%d-%d-%dT%d:%d:%d", &year, &mon, &mday, &hour,
&min, &sec);
static double _lon1 = -9999;
static double _lon2 = -9999;
- static double x1, y1, z1;
- static double x2, y2, z2;
- static double xa, ya, za, la;
+ static double x1;
+ static double y1;
+ static double z1;
+ static double x2;
+ static double y2;
+ static double z2;
+ static double xa;
+ static double ya;
+ static double za;
+ static double la;
double dot;
*/
void IgcFormat::TaskRecordReader::igc_task_rec(const char* rec)
{
- unsigned int lat_deg, lat_min, lat_frac;
- unsigned int lon_deg, lon_min, lon_frac;
- char lat_hemi[2], lon_hemi[2];
+ unsigned int lat_deg;
+ unsigned int lat_min;
+ unsigned int lat_frac;
+ unsigned int lon_deg;
+ unsigned int lon_min;
+ unsigned int lon_frac;
+ char lat_hemi[2];
+ char lon_hemi[2];
char tmp_str[kMaxRecLen];
// First task record identifies the task to follow
void IgcFormat::read()
{
char* ibuf;
- int hours, mins, secs;
- unsigned int lat_deg, lat_min, lat_frac;
- unsigned int lon_deg, lon_min, lon_frac;
- char lat_hemi[2], lon_hemi[2];
+ int hours;
+ int mins;
+ int secs;
+ unsigned int lat_deg;
+ unsigned int lat_min;
+ unsigned int lat_frac;
+ unsigned int lon_deg;
+ unsigned int lon_min;
+ unsigned int lon_frac;
+ char lat_hemi[2];
+ char lon_hemi[2];
char validity;
route_head* pres_head = nullptr;
route_head* gnss_head = nullptr;
- int pres_alt, gnss_alt;
+ int pres_alt;
+ int gnss_alt;
char pres_valid = 0;
char gnss_valid = 0;
Waypoint* pres_wpt = nullptr;
void KmlFormat::wpt_coord(const QString& args, const QXmlStreamAttributes* /*attrs*/)
{
- double lat, lon, alt;
+ double lat;
+ double lon;
+ double alt;
if (! wpt_tmp) {
return;
}
fatal(MYNAME ": gx_trk_coord: invalid kml file\n");
}
- double lat, lon, alt;
+ double lat;
+ double lon;
+ double alt;
int n = sscanf(CSTR(args), "%lf %lf %lf", &lon, &lat, &alt);
if (EOF != n && 2 != n && 3 != n) {
fatal(MYNAME ": coord field decode failure on \"%s\".\n", qPrintable(args));
void
LowranceusrFormat::lowranceusr_waypt_disp(const Waypoint* wpt) const
{
- int SymbolId, alt;
+ int SymbolId;
+ int alt;
int Lat = lat_deg_to_mm(wpt->latitude);
int Lon = lon_deg_to_mm(wpt->longitude);
it means */
gbfputint32(2, file_out);
- int SymbolId, ColorId;
+ int SymbolId;
+ int ColorId;
if (!wpt->gc_data->get_icon().isEmpty() && wpt->icon_descr.compare(u"Geocache Found") == 0) {
if (writing_version == 4) {
SymbolId = lowranceusr4_find_icon_number_from_desc(wpt->icon_descr);
// transferred to either the global_waypoint_list or global_track_list.
wpt->extra_data = nullptr;
if (datum != kDautmWGS84) {
- double lat, lon, alt;
+ double lat;
+ double lon;
+ double alt;
GPS_Math_Known_Datum_To_WGS84_M(
wpt->latitude, wpt->longitude, 0,
&lat, &lon, &alt, datum);
if (nfields > cnt + 3) prn[cnt] = fields[cnt + 3].toInt();
}
- float pdop = 0, hdop = 0, vdop = 0;
+ float pdop = 0;
+ float hdop = 0;
+ float vdop = 0;
if (nfields > 15) pdop = fields[15].toFloat();
if (nfields > 16) hdop = fields[16].toFloat();
if (nfields > 17) vdop = fields[17].toFloat();
void
NmeaFormat::pcmpt_parse(const char* ibuf)
{
- int i, j1, j2, j3, j4, j5, j6;
- int lat, lon;
- char altflag, u1, u2;
- float alt, f1, f2;
+ int i;
+ int j1;
+ int j2;
+ int j3;
+ int j4;
+ int j5;
+ int j6;
+ int lat;
+ int lon;
+ char altflag;
+ char u1;
+ char u2;
+ float alt;
+ float f1;
+ float f2;
char coords[20] = {0};
- int dmy, hms;
+ int dmy;
+ int hms;
dmy = hms = 0;
void
OsmFormat::osm_node_tag(const QString& /*unused*/, const QXmlStreamAttributes* attrv)
{
- QString key, value;
+ QString key;
+ QString value;
signed char ikey;
if (attrv->hasAttribute("k")) {
void
OsmFormat::osm_way_tag(const QString& /*unused*/, const QXmlStreamAttributes* attrv)
{
- QString key, value;
+ QString key;
+ QString value;
signed char ikey;
if (attrv->hasAttribute("k")) {
OziFormat::ozi_convert_datum(Waypoint* wpt) const
{
if (datum != kDautmWGS84) {
- double lat, lon, alt;
+ double lat;
+ double lon;
+ double alt;
GPS_Math_Known_Datum_To_WGS84_M(wpt->latitude, wpt->longitude, 0.0,
&lat, &lon, &alt, datum);
wpt->latitude = lat;
parse_coordinates(const char* str, int datum, const grid_type grid,
double* latitude, double* longitude, const char* module)
{
- double lat, lon;
- unsigned char lathemi=0, lonhemi=0;
- int deg_lat, deg_lon, min_lat, min_lon;
+ double lat;
+ double lon;
+ unsigned char lathemi=0;
+ unsigned char lonhemi=0;
+ int deg_lat;
+ int deg_lon;
+ int min_lat;
+ int min_lon;
char map[3];
int utmz;
- double utme, utmn;
+ double utme;
+ double utmn;
char utmc;
int result;
int ct;
- double lx, ly;
+ double lx;
+ double ly;
const char* format;
int valid = 1;
break;
case grid_swiss: {
- double east, north;
+ double east;
+ double north;
datum = kDautmWGS84; /* fix */
format = "%lf %lf%n";
SkytraqBase::skytraq_rd_msg(void* payload, unsigned int len) const
{
int errors = 5; // Allow this many receiver errors silently.
- unsigned int c, i, state;
+ unsigned int c;
+ unsigned int i;
+ unsigned int state;
signed int rcv_len; // Negative length is read error.
for (i = 0, state = 0; i < RETRIES && state < sizeof(MSG_START); i++) {
{
// an0008-1.4.14: logs if
// (dt > tmin & dd >= dmin & v >= vmin) | dt > tmax | dd > dmax | v > vmax
- unsigned int tmin=6, tmax=3600, dmin=0, dmax=10000;
+ unsigned int tmin=6;
+ unsigned int tmax=3600;
+ unsigned int dmin=0;
+ unsigned int dmax=10000;
static uint8_t MSG_LOG_CONFIGURE_CONTROL[] = {
0x18, // message_id
0x00, 0x00, 0x0e, 0x10, // max_time: was 0x0000ffff (big endian!)
int /* returns number of bytes processed (terminates on 0xFF i.e. empty or padding bytes) */
SkytraqBase::process_data_sector(read_state* pst, const uint8_t* buf, int len) const
{
- int plen, ilen;
+ int plen;
+ int ilen;
for (plen = 0; plen < len && buf[plen] != 0xFF; plen += ilen) {
ilen = process_data_item(pst, reinterpret_cast<const item_frame*>(&buf[plen]), len-plen);
{
uint8_t MSG_LOG_SECTOR_READ_CONTROL[2] = { 0x1B, (uint8_t)(sector) };
int errors = 5; /* allow this many errors */
- unsigned int c, i, j, cs;
+ unsigned int c;
+ unsigned int i;
+ unsigned int j;
+ unsigned int cs;
uint8_t buffer[16];
if (sector > 0xFF) {
{
read_state st;
uint32_t log_wr_ptr;
- uint16_t sectors_free, sectors_total, /*sectors_used_a, sectors_used_b,*/ sectors_used;
- int t, rc, got_sectors, total_sectors_read = 0;
+ uint16_t sectors_free;
+ uint16_t sectors_total;
+ /* uint16_t sectors_used_a; */
+ /* uint16_t sectors_used_b; */
+ uint16_t sectors_used;
+ int t;
+ int rc;
+ int got_sectors;
+ int total_sectors_read = 0;
int read_at_once = MAX(xstrtoi(opt_read_at_once, nullptr, 10), 1);
int opt_first_sector_val = xstrtoi(opt_first_sector, nullptr, 10);
int opt_last_sector_val = xstrtoi(opt_last_sector, nullptr, 10);
void
SkytraqBase::skytraq_set_location() const
{
- double lat, lng;
+ double lat;
+ double lng;
uint8_t MSG_SET_LOCATION[17] = { 0x36, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
uint8_t MSG_GET_LOCATION = 0x35;
{
uint8_t MSG_GET_POI[3] = { 0x4D, 0, 0};
uint8_t buf[32];
- double lat, lng, alt;
+ double lat;
+ double lng;
+ double alt;
for (unsigned int poi = 0; poi<NUMPOI; poi++) {
MSG_GET_POI[1]=(poi>>8)&0xff;
0, 0, 0, 0, 0, 0, 0, 0, //alt (double ecef)
0 // attr (u8, 1-> to flash, 0->ro sram)
};
- double lat, lng, alt;
- double ecef_x, ecef_y, ecef_z;
+ double lat;
+ double lng;
+ double alt;
+ double ecef_x;
+ double ecef_y;
+ double ecef_z;
int result = 0; // result will be 0 if opt_poi isn't set
(wpt1->GetCreationTime() != wpt2->GetCreationTime())) {
double frac = static_cast<double>(wpt1->GetCreationTime().msecsTo(wpt3->GetCreationTime())) /
static_cast<double>(wpt1->GetCreationTime().msecsTo(wpt2->GetCreationTime()));
- double reslat, reslon;
+ double reslat;
+ double reslon;
linepart(wpt1->latitude, wpt1->longitude,
wpt2->latitude, wpt2->longitude,
frac, &reslat, &reslon);
TextFormat::text_disp(const Waypoint* wpt)
{
int32_t utmz;
- double utme, utmn;
+ double utme;
+ double utmn;
char utmzc;
waypoint_count++;
void
TpgFormat::tpg_waypt_pr(const Waypoint* wpt)
{
- double lon, lat;
+ double lon;
+ double lat;
double amt;
char ocount;
QString shortname;
void TrackFilter::trackfilter_pack()
{
if (!track_list.isEmpty()) {
- int i, j;
+ int i;
+ int j;
for (i = 1, j = 0; i < track_list.size(); i++, j++) {
auto prev_last_time = trackfilter_get_last_time(track_list.at(j));
void TrackFilter::trackfilter_range()
{
- QDateTime start, stop; // constructed such that isValid() is false, unlike gpsbabel::DateTime!
+ QDateTime start; // constructed such that isValid() is false, unlike gpsbabel::DateTime!
+ QDateTime stop; // constructed such that isValid() is false, unlike gpsbabel::DateTime!
if (opt_start != nullptr) {
start = trackfilter_range_check(opt_start);
QDate
UnicsvFormat::unicsv_parse_date(const char* str, int* consumed)
{
- int p1, p2, p3;
+ int p1;
+ int p2;
+ int p3;
char sep[2];
std::tm tm{};
int lconsumed = 0;
void
UnicsvFormat::unicsv_waypt_disp_cb(const Waypoint* wpt)
{
- double lat, lon, alt;
+ double lat;
+ double lon;
+ double alt;
const Geocache* gc_data = nullptr;
unicsv_waypt_ct++;
case grid_bng: {
char map[3];
- double north, east;
+ double north;
+ double east;
if (! GPS_Math_WGS84_To_UKOSMap_M(wpt->latitude, wpt->longitude, &east, &north, map)) {
unicsv_fatal_outside(wpt);
case grid_utm: {
int zone;
char zonec;
- double north, east;
+ double north;
+ double east;
if (! GPS_Math_Known_Datum_To_UTM_EN(lat, lon,
&east, &north, &zone, &zonec, unicsv_datum_idx)) {
break;
}
case grid_swiss: {
- double north, east;
+ double north;
+ double east;
if (! GPS_Math_WGS84_To_Swiss_EN(wpt->latitude, wpt->longitude, &east, &north)) {
unicsv_fatal_outside(wpt);
XcsvFormat::xcsv_waypt_pr(const Waypoint* wpt)
{
QString buff;
- double latitude, longitude;
+ double latitude;
+ double longitude;
int32_t utmz;
- double utme, utmn;
+ double utme;
+ double utmn;
char utmzc;
if (oldlon < 900) {
/* SPECIAL COORDINATES */
case XcsvStyle::XT_MAP_EN_BNG: {
char map[3];
- double north, east;
+ double north;
+ double east;
if (! GPS_Math_WGS84_To_UKOSMap_M(wpt->latitude, wpt->longitude, &east, &north, map))
fatal(MYNAME ": Position (%.5f/%.5f) outside of BNG.\n",
wpt->latitude, wpt->longitude);